'''
人生苦短，我用Python
班级:1906B
日期:{2020/5/6}
阶段：Python爬虫

'''
import upyun

# 新建又拍云实例
up = upyun.UpYun('000425', 'songshenao000425', 'rAipmyJNdgshd4JI39DbbUlU1QVepW9C')

#上传文件
# up.put('/upyun_test.txt','adfadsfadf\n你好你好你好')

#文件流操作（节省内存）

# with open('./md.png','rb') as f:
#     #上传操作
#     res = up.put('/upyun_test.txt',f,checksum=True)
#目录操作
#up.mkdir(/upyun_test/)

# 移动文件
# up.move('/upyun_test.png','/upyun_test/upyun_test.png')

#复制文件
# up.copy('/upyun_test.txt','/upyun_test/upyun_test.txt')

#断点续传
with open('c:/1jm.jpg','rb') as f:
    res = up.copy('/upyun_test/test.mp4',f,checksum=True,need_resume=True)
#下载文件
# res = up.get('/upyun_test/upyun_test.png')





